<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>window对象</h1>
    <a href="https://www.woniuxy.com" target="_blank">蜗牛学院</a>

    <button id="link">蜗牛学院</button>
    <button id="stopInterval">暂停计时器</button>
    <button id="stopTimeout">暂停延时器</button>
    <script>

        let intervalId = setInterval(() => {
            console.log("你好");
        }, 1000);

        stopInterval.onclick = function () {
            clearInterval(intervalId)
        }



        let timeoutId = setTimeout(() => {
            console.log("2秒后输出");
        }, 2000);

        stopTimeout.onclick = function () {
            clearTimeout(timeoutId)
        }


        // console.log(window.innerHeight, window.innerWidth);
        // console.log(innerHeight, innerWidth);

        // // window.prompt();
        // link.onclick = function () {
        //     window.open("https://www.woniuxy.com");
        // }

    </script>
</body>

</html>